home *** CD-ROM | disk | FTP | other *** search
/ Publication 5 / Publication_05_19xx_High-Tech_de_Side_A.d64 / earthworms (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  93 lines

  1. 1 rem earthworms
  2. 100 mc=54272:vc=53248:pokevc+32,6:pokevc+33,15
  3. 110 printchr$(147):m=((peek(53272)and240)/16)*1024:c=55296
  4. 150 print"[144]              earthworms                [146]";
  5. 155 gosub2300
  6. 160 print"as you crawl through the dirt you must  eat algae ([209][144]) and avoid"
  7. 170 print"sharp pebbles ([218][144])."
  8. 175 print"hitting pebbles or the border of the"
  9. 180 print"screen or crossing a previous tunnel    will end the game."
  10. 185 gosub2400
  11. 190 print"control direction with the joystick."
  12. 200 print"ten points for each algae ball you eat."
  13. 210 gosub2500:gosub2000
  14. 220 printchr$(147);"  enter skill level:":print"   1[146] beginner"
  15. 225 print"     -to-":print"   5[146] advanced"
  16. 230 getx$:ifx$=""then230
  17. 240 sc=0:sl=val(x$):ifsl<1orsl>5then230
  18. 245 lt=(11-(sl*2)):iflt>7thenlt=7
  19. 250 printchr$(147):fory=1to(sl*6):gosub2100:pokem+x,90:pokec+x,6:nexty
  20. 260 ac=sl*20:fory=1toac:gosub2100:pokem+x,81:pokec+x,5:nexty
  21. 270 h1=20:v1=12:pokem+500,160:pokec+500,2
  22. 275 :
  23. 280 h2=0:v2=0:x=1:ifrnd(1)>.5thenx=-1
  24. 290 lc=0:h2=x:ifrnd(1)>.5thenh2=0:v2=x
  25. 300 h3=0:v3=0:gosub2200:ifv3<>0orh3<>0thenh2=h3:v2=v3:goto360
  26. 340 lc=lc+1:iflc<ltthen300
  27. 350 lc=0
  28. 360 h1=h1+h2:v1=v1+v2:ifh1<0orh1>39orv1<0orv1>24then700
  29. 370 x=peek(m+h1+(v1*40))
  30. 380 ifx=32orx=81thenpokem+h1+(v1*40),160:pokec+h1+(v1*40),2:goto410
  31. 390 ifx=160orx=90then700
  32. 400 goto300
  33. 410 ifx=32then300
  34. 420 rem ***** eat algae
  35. 430 pokemc+0,0:pokemc+1,0:pokemc+24,15
  36. 440 forx=50to10step-10
  37. 445 pokemc+1,x:pokemc+4,129
  38. 450 fory=1to10:nexty:pokemc+4,128:nextx
  39. 460 pokemc+24,0
  40. 470 sc=sc+10:ac=ac-1
  41. 480 ifac<1then250
  42. 490 goto300
  43. 700 rem ***** game over
  44. 701 pokemc+0,0:pokemc+1,20:pokemc+4,17:pokemc+24,15
  45. 702 fory=1to500:nexty:pokemc+4,16:pokemc+24,0
  46. 710 printchr$(147);"               game over![146]"
  47. 720 print"    score =";sc
  48. 730 print"    replay? (y[146] or n[146])"
  49. 740 getx$:ifx$=""then740
  50. 750 ifx$="y"then220
  51. 760 ifx$<>"n"then740
  52. 770 gosub2400:gosub2500
  53. 780 printchr$(147)
  54. 790 end
  55. 2000 print"        (press any key to start)"
  56. 2010 getx$:ifx$=""then2010
  57. 2020 return
  58. 2100 x=int(rnd(1)*1000):ifpeek(m+x)<>32then2100
  59. 2110 return
  60. 2200 rem ***** read joystick
  61. 2210 x=peek(56321)
  62. 2220 if(xand1)=0thenv3=-1
  63. 2230 if(xand2)=0thenv3=1
  64. 2240 if(xand4)=0thenh3=-1
  65. 2250 if(xand8)=0thenh3=1
  66. 2260 return
  67. 2300 rem ***** load sprite definitions
  68. 2310 forx=832to832+63:pokex,0:nextx
  69. 2320 forx=896to896+63:readz:pokex,z:nextx
  70. 2330 forx=832+48to832+56:readz:pokex,z:nextx:return
  71. 2400 rem ***** setup for sprite & notes
  72. 2410 forx=54272to54296:pokex,0:nextx
  73. 2420 pokemc+1,10:pokemc+4,17:pokemc+5,15
  74. 2430 pokemc+6,15
  75. 2440 pokevc+0,0:pokevc+1,200:pokevc+16,0
  76. 2450 pokevc+23,1:pokevc+28,0:pokevc+29,0
  77. 2460 pokevc+39,2:poke2040,13
  78. 2470 return
  79. 2500 rem ***** draw sprite
  80. 2510 pokemc+24,15:pokevc+21,1:x=5:z=25
  81. 2520 poke2040,13:fory=1to50:nexty:pokemc+4,16
  82. 2525 pokevc+0,z:z=z+10
  83. 2530 poke2040,14
  84. 2540 pokemc+1,x:x=x+3:pokemc+4,17
  85. 2550 ifz=265thenpokevc+0,0:pokevc+16,1:z=0
  86. 2560 ifz<>100then2520
  87. 2570 pokemc+24,0:pokevc+21,0
  88. 2580 return
  89. 3000 data0,62,0,0,99,0,0,99,0,0,65,0,0,193,128,0,193,128,0,128,128,1,128,192
  90. 3010 data1,128,192,1,0,64,3,0,96,3,0,96,2,0,32,6,0,48,6,0,48,4,0,16,4,0
  91. 3020 data16,4,0,16,252,0,31,0,0,0,0,0,0,0
  92. 3030 data0,60,0,0,102,0,255,195,255
  93.